package com.pm.service.official.impl;

import com.pm.entity.po.official.OfficialScoreStatistics;
import com.pm.mapper.official.OfficialRankStatisticsMapper;
import com.pm.mapper.official.OfficialScoreStatisticsMapper;
import com.pm.service.impl.BaseServiceImpl;
import com.pm.service.official.OfficialScoreStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @program: pm_info_api
 * @description: 党政一把手
 * @author: xzj
 * @create: 2020-08-19 18:23
 **/
@Service
public class OfficialScoreStatisticsServiceImpl extends BaseServiceImpl<OfficialScoreStatistics> implements OfficialScoreStatisticsService {

    @Autowired
    OfficialScoreStatisticsMapper officialScoreStatisticsMapper;
    @Resource
    private void setBaseMapper(OfficialScoreStatisticsMapper officialScoreStatisticsMapper) {
        super.setBaseMapper(officialScoreStatisticsMapper);
    }

    @Override
    public Integer addOne(OfficialScoreStatistics officialScoreStatistics) {
        if (officialScoreStatistics.getId()!=null){
            officialScoreStatisticsMapper.removeOne(officialScoreStatistics.getId());
            return officialScoreStatisticsMapper.addOne(officialScoreStatistics);
        }
        return officialScoreStatisticsMapper.addOne(officialScoreStatistics);
    }
}
